const express = require('express');
const bodyParser = require('body-parser');
const path = require('path');
require('./model/connect');
require('express-art-template');
//创建服务器
const app = express();
//开发静态资源服务
app.use(express.static(path.join(__dirname,'public')));
//用bodyparser处理全部请求
app.use(bodyParser.urlencoded({extended: false}));

app.use('/todo',require('./route/todo'));

app.get('/users/:id',(req,res)=>{
    const id = req.params.id;
    res.send(id)
})
app.delete('/users/:id',(req,res)=>{
    const id = req.params.id;
    res.send(id)
})
app.put('/users/:id',(req,res)=>{
    const id = req.params.id;
    res.send(id)
})


app.listen(3000);
console.log('服务器启动成功');